package com.example.smartmedicalsystem.repository;

import com.example.smartmedicalsystem.entity.Medicine;
import com.example.smartmedicalsystem.entity.PatientInventory;
import com.example.smartmedicalsystem.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PatientInventoryRepository extends JpaRepository<PatientInventory, Long> {
    // 根据患者查询库存
    List<PatientInventory> findByPatient(User patient);

    // 根据患者和药品查询记录
    List<PatientInventory> findByPatientAndMedicine(User patient, Medicine medicine);
}